package com.lysj.order.order.domain;

import com.lysj.admin.utils.spring.foundation.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @author Created by drj on 2019-03-13 10:43:06
 * @description 订单详情控制层
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
@Table(name = "lysj_order_order_item")
public class OrderItem extends BaseEntity {

    @Getter
    public enum Status {
        GOODS(1, "点菜"),
        GIFT(2, "赠菜"),
        CANCLE(3, "退菜"),
        TEA(4, "茶座费");

        private Integer code;

        private String status;

        Status(Integer code, String status) {
            this.code = code;
            this.status = status;
        }
    }


    private String orderId;//订单id

    private String foodId; //菜品id

    private Integer amount;//菜品数量

    private String specifications;//规格(口味)

    private String doWay;//做法

    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal unitPrice;//单价

    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal tolPrice;//总价

    private Integer status; //状态


}